Skip to content
This repository was archived by the owner on Dec 27, 2018. It is now read-only.

Fix the 'this' context that is passed to mocha functions to be compat…#10

Open
yossarian21 wants to merge 1 commit into
practicalmeteor:practicalmeteorfrom
yossarian21:practicalmeteor
Open

Fix the 'this' context that is passed to mocha functions to be compat…#10
yossarian21 wants to merge 1 commit into
practicalmeteor:practicalmeteorfrom
yossarian21:practicalmeteor

Conversation

@yossarian21

Copy link
Copy Markdown

…ible with Mocha's Shared Behaviors features: https://github.com/mochajs/mocha/wiki/Shared-Behaviours.

This allows setups like this to work; this works on client but not on server before the fix:
helpers.js:
beforeEach(function () { this.sandbox = sinon.sandbox.create(); }); afterEach(function () { this.sandbox.restore(); });

myTests.js:
describe('some module', function () { it('has a sandbox', function () { expect(this.sandbox).to.be.ok; } });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant